import axiosInstance from './axiosInstance';

export const categoryService = {
  // 获取所有类别（包括已删除的）
  async getAllCategories() {
    // 添加参数获取所有类别，包括已删除的
    return axiosInstance.get('/categories/admin/all', { params: { include_deleted: true } });
  },
  
  // 获取单个类别详情
  async getCategory(id) {
    return axiosInstance.get(`/categories/${id}`);
  },
  
  // 创建类别
  async createCategory(params) {
    return axiosInstance.post('/categories', params);
  },
  
  // 更新类别
  async updateCategory(id, params) {
    return axiosInstance.put(`/categories/${id}`, params);
  },
  
  // 删除类别
  async deleteCategory(id) {
    return axiosInstance.delete(`/categories/${id}`);
  }
};